
package com.gitee.elead.model;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.gitee.elead.model.serializer.DateTimeJsonDeserializer;
import com.gitee.elead.model.serializer.UserJsonSerializer;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 主键父类
 * </p>
 *
 * @author luopeng
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@SuppressWarnings("serial")
public class CommonModel extends BaseModel {

	/** 排序字段 */
	@ApiModelProperty(value = "排序字段", hidden = true)
	private Integer orderby;
	/** 乐观锁 */
	@ApiModelProperty(value = "乐观锁", hidden = true)
	private Integer revision;
	/** 逻辑删除 */
	@ApiModelProperty(value = "逻辑删除", hidden = true)
	@TableLogic
	private Integer deleted;
	/** 创建人 */
	@ApiModelProperty(value = "创建人", hidden = true)
	@TableField(fill = FieldFill.INSERT)
	@JsonSerialize(using = UserJsonSerializer.class)
	private String createdBy;
	/** 创建时间 */
	@ApiModelProperty(value = "创建时间", hidden = true)
	@TableField(fill = FieldFill.INSERT)
	@JsonDeserialize(using =DateTimeJsonDeserializer.class)
	private LocalDateTime createdTime;
	/** 更新人 */
	@ApiModelProperty(value = "更新人", hidden = true)
	@TableField(fill = FieldFill.INSERT_UPDATE)
	@JsonSerialize(using = UserJsonSerializer.class)
	private String updatedBy;
	/** 更新时间 */
	@ApiModelProperty(value = "更新时间", hidden = true)
	@TableField(fill = FieldFill.INSERT_UPDATE)
	@JsonDeserialize(using =DateTimeJsonDeserializer.class)
	private LocalDateTime updatedTime;
}
